
// 解决H5跨域问题， 临时修改，APP需要改回来
let api = '/api'
let codeerr = false;


let upload = function(obj){

	return new Promise(function(resolve, reject){
		uni.uploadFile({
		    url: api + obj.url,
		    filePath: obj.data,
		    name: 'file',
		    success: (res)=>{
		    	resolve(res.data)
		    },
		    fail: (err)=>{
		    	reject(err.response)
		    }
		});
		
	})
}


export{
	api,
	upload
};
 